<style>
    .layui-form .layui-form-item .layui-inline input{
        width: 200px;
    }
</style>
<form class="layui-form seller-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" style="width:150px">key：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="username" placeholder="username" autocomplete="off"
                       maxlength="50" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="width:150px">Create Time：</label>
            <div class="layui-input-inline seller-inline-4">
                <input type="text" name="datetime" id="datetime" placeholder="start_time _ end_time" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-sm" lay-submit lay-filter="*"><i class="iconfont icon-chaxun"></i>Search</button>
                <!--<a href="javascript:;" class="layui-btn layui-btn-sm" id="add"><i class="layui-icon">&#xe608;</i>Add</a>-->
            </div>
        </div>
    </div>
</form>
<div class="table-body">
    <table id="balanceTable" lay-filter="balanceTable"></table>
</div>
<script type="text/html" id="toolbar">
    <button type="button" class="layui-btn layui-btn-sm" lay-event="up_rate">更新手续费</button>
</script>
<script>
    layui.use(['form', 'laydate', 'table',], function () {
        var laydate = layui.laydate,
            form = layui.form,
            table = layui.table; //表格
        //时间插件
        laydate.render({
            elem: '#datetime',
            range: '_',
            format: 'yyyy-MM-dd'
        });
        var tableIn = table.render({
            elem: '#balanceTable',
            height: 'full-99',
            cellMinWidth: '80',
            // totalRow: true,
            toolbar: '#toolbar',
            method: 'post',
            url: "{:url('userSet')}",
            id: 'balanceTable',
            cols: [[
                { type: 'checkbox', fixed: 'left'},
                { type: 'numbers'},
                { field: 'username', align: 'left', title: '用户', width:200 ,
                    templet:function (d) {
                        const user_id=   d.user_id;
                        if(user_id != 0){
                            return d.username;
                        }else{
                            return '默认设置';
                        }
                    }
                },

                { field: 'option', title: '操作', templet: function (d) {
                        // return '<a class="layui-btn layui-btn-xs editMax" data-id="' + d.id + '">Edit</a>';
                        var html = '<a style="color: #0e8df3;" ' +
                            'href="' + "{:url('cardSet')}?id=" + d.id + '">Edit</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
                        html += '<a class="layui-btn layui-btn-xs SearchDetail" data-id="' + d.id + '">info</a>';
                        return html;
                    }, align: 'center' ,width:150,
                },
                { align: 'left', title: '创建时间',width:160,
                    templet: function (d) {
                        const ctime = d.ctime;
                        if(ctime == undefined){
                            return '--';
                        }else{
                            return layui.util.toDateString(d.ctime * 1000, "yyyy-MM-dd HH:mm:ss");
                        }

                    }
                },
                { field: 'type', align: 'left', title: '用户类型', width:100 ,
                    templet:function (d) {
                        const type=   d.type;
                        if(type == 0){
                            return '普通';
                        }else if(type == 1){
                            return '<span style="color: #8c8c8c">实名认证</span>';
                        }else{
                            return '<span style="color: green">自定义</span>';'';
                        }
                    }
                },
                { field: 'max_card',  align: 'left', title: '建卡上限' ,width:120 },
                { field: 'zero_auth',  align: 'left', title: '0验证' ,width:120 },
                { field: 'declined',  align: 'left', title: 'declined(普通)' ,width:150 },
                { field: 'facebook',  align: 'left', title: 'declined(facebook)' ,width:150 },
                { field: 'card_set',  align: 'left', title: '(1)531847 是否开停|充值|开卡|退款' ,width:250 ,
                    templet:function (d) {
                        const fund_1_531847 =   d.fund_1_531847;
                        var color = ''
                        if(fund_1_531847 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_1_531847 == 1){
                             html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                             html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_1_531847 + ' | '
                            + d.open_1_531847 + ' | '
                            + d.refund_1_531847
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(1)556305' ,width:180 ,
                    templet:function (d) {
                        const fund_1_556305 =   d.fund_1_556305;
                        var color = ''
                        if(fund_1_556305 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_1_556305 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_1_556305 + ' | '
                            + d.open_1_556305 + ' | '
                            + d.refund_1_556305
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(1)556735' ,width:180 ,
                    templet:function (d) {
                        const fund_1_556735 =   d.fund_1_556735;
                        var color = ''
                        if(fund_1_556735 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_1_556735 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_1_556735 + ' | '
                            + d.open_1_556735 + ' | '
                            + d.refund_1_556735
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(1)556766' ,width:180 ,
                    templet:function (d) {
                        const fund_1_556766 =   d.fund_1_556766;
                        var color = ''
                        if(fund_1_556766 == 0.00){
                            color = 'red';
                        }

                        var html = '';
                        if(d.use_1_556766 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_1_556766 + ' | '
                            + d.open_1_556766 + ' | '
                            + d.refund_1_556766
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(1)558068' ,width:180 ,
                    templet:function (d) {
                        const fund_1_558068 =   d.fund_1_558068;
                        var color = ''
                        if(fund_1_558068 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_1_558068 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_1_558068 + ' | '
                            + d.open_1_558068 + ' | '
                            + d.refund_1_558068
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)404038' ,width:180 ,
                    templet:function (d) {
                        const fund_3_404038 =   d.fund_3_404038;
                        var color = ''
                        if(fund_3_404038 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_404038 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_404038 + ' | '
                            + d.open_3_404038 + ' | '
                            + d.refund_3_404038
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)440872' ,width:180 ,
                    templet:function (d) {
                        const fund_3_440872 =   d.fund_3_440872;
                        var color = ''
                        if(fund_3_440872 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_440872 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_440872 + ' | '
                            + d.open_3_440872 + ' | '
                            + d.refund_3_440872
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)451946' ,width:180 ,
                    templet:function (d) {
                        const fund_3_451946 =   d.fund_3_451946;
                        var color = ''
                        if(fund_3_451946 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_451946 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_451946 + ' | '
                            + d.open_3_451946 + ' | '
                            + d.refund_3_451946
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)485997' ,width:180 ,
                    templet:function (d) {
                        const fund_3_485997 =   d.fund_3_485997;
                        var color = ''
                        if(fund_3_485997 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_485997 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_485997 + ' | '
                            + d.open_3_485997 + ' | '
                            + d.refund_3_485997
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)519075' ,width:180 ,
                    templet:function (d) {
                        const fund_3_519075 =   d.fund_3_519075;
                        var color = ''
                        if(fund_3_519075 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_519075 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_519075 + ' | '
                            + d.open_3_519075 + ' | '
                            + d.refund_3_519075
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)531993' ,width:180 ,
                    templet:function (d) {
                        const fund_3_531993 =   d.fund_3_531993;
                        var color = ''
                        if(fund_3_531993 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_531993 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_531993 + ' | '
                            + d.open_3_531993 + ' | '
                            + d.refund_3_531993
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)534786' ,width:180 ,
                    templet:function (d) {
                        const fund_3_534786 =   d.fund_3_534786;
                        var color = ''
                        if(fund_3_534786 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_534786 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_534786 + ' | '
                            + d.open_3_534786 + ' | '
                            + d.refund_3_534786
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)553437' ,width:180 ,
                    templet:function (d) {
                        const fund_3_553437 =   d.fund_3_553437;
                        var color = ''
                        if(fund_3_553437 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_553437 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_553437 + ' | '
                            + d.open_3_553437 + ' | '
                            + d.refund_3_553437
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)556150' ,width:180 ,
                    templet:function (d) {
                        const fund_3_556150 =   d.fund_3_556150;
                        var color = ''
                        if(fund_3_556150 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_556150 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_556150 + ' | '
                            + d.open_3_556150 + ' | '
                            + d.refund_3_556150
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)556371' ,width:180 ,
                    templet:function (d) {
                        const fund_3_556371 =   d.fund_3_556371;
                        var color = ''
                        if(fund_3_556371 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_556371 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_556371 + ' | '
                            + d.open_3_556371 + ' | '
                            + d.refund_3_556371
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)559292' ,width:180 ,
                    templet:function (d) {
                        const fund_3_559292 =   d.fund_3_559292;
                        var color = ''
                        if(fund_3_559292 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_559292 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_559292 + ' | '
                            + d.open_3_559292 + ' | '
                            + d.refund_3_559292
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)559666' ,width:180 ,
                    templet:function (d) {
                        const fund_3_559666 =   d.fund_3_559666;
                        var color = ''
                        if(fund_3_559666 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_559666 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_559666 + ' | '
                            + d.open_3_559666 + ' | '
                            + d.refund_3_559666
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)433451' ,width:180 ,
                    templet:function (d) {
                        const fund_3_433451 =   d.fund_3_433451;
                        var color = ''
                        if(fund_3_433451 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_433451 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_433451 + ' | '
                            + d.open_3_433451 + ' | '
                            + d.refund_3_433451
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)524897' ,width:180 ,
                    templet:function (d) {
                        const fund_3_524897 =   d.fund_3_524897;
                        var color = ''
                        if(fund_3_524897 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_524897 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_524897 + ' | '
                            + d.open_3_524897 + ' | '
                            + d.refund_3_524897
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)553231' ,width:180 ,
                    templet:function (d) {
                        const fund_3_553231 =   d.fund_3_553231;
                        var color = ''
                        if(fund_3_553231 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_553231 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_553231 + ' | '
                            + d.open_3_553231 + ' | '
                            + d.refund_3_553231
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)553370' ,width:180 ,
                    templet:function (d) {
                        const fund_3_553370 =   d.fund_3_553370;
                        var color = ''
                        if(fund_3_553370 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_553370 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_553370 + ' | '
                            + d.open_3_553370 + ' | '
                            + d.refund_3_553370
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)447420' ,width:180 ,
                    templet:function (d) {
                        const fund_3_447420 =   d.fund_3_447420;
                        var color = ''
                        if(fund_3_447420 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_447420 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_447420 + ' | '
                            + d.open_3_447420 + ' | '
                            + d.refund_3_447420
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)491090' ,width:180 ,
                    templet:function (d) {
                        const fund_3_491090 =   d.fund_3_491090;
                        var color = ''
                        if(fund_3_491090 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_491090 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_491090 + ' | '
                            + d.open_3_491090 + ' | '
                            + d.refund_3_491090
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)483317' ,width:180 ,
                    templet:function (d) {
                        const fund_3_483317 =   d.fund_3_483317;
                        var color = ''
                        if(fund_3_483317 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_483317 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_483317 + ' | '
                            + d.open_3_483317 + ' | '
                            + d.refund_3_483317
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)476715' ,width:180 ,
                    templet:function (d) {
                        const fund_3_476715 =   d.fund_3_476715;
                        var color = ''
                        if(fund_3_476715 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_476715 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_476715 + ' | '
                            + d.open_3_476715 + ' | '
                            + d.refund_3_476715
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)428836' ,width:180 ,
                    templet:function (d) {
                        const fund_3_428836 =   d.fund_3_428836;
                        var color = ''
                        if(fund_3_428836 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_428836 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_428836 + ' | '
                            + d.open_3_428836 + ' | '
                            + d.refund_3_428836
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)556167' ,width:180 ,
                    templet:function (d) {
                        const fund_3_556167 =   d.fund_3_556167;
                        var color = ''
                        if(fund_3_556167 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_556167 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_556167 + ' | '
                            + d.open_3_556167 + ' | '
                            + d.refund_3_556167
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)441112' ,width:180 ,
                    templet:function (d) {
                        const fund_3_441112 =   d.fund_3_441112;
                        var color = ''
                        if(fund_3_441112 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_441112 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_441112 + ' | '
                            + d.open_3_441112 + ' | '
                            + d.refund_3_441112
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)553301' ,width:180 ,
                    templet:function (d) {
                        const fund_3_553301 =   d.fund_3_553301;
                        var color = ''
                        if(fund_3_553301 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_553301 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_553301 + ' | '
                            + d.open_3_553301 + ' | '
                            + d.refund_3_553301
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)424605' ,width:180 ,
                    templet:function (d) {
                        const fund_3_424605 =   d.fund_3_424605;
                        var color = ''
                        if(fund_3_424605 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_424605 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_424605 + ' | '
                            + d.open_3_424605 + ' | '
                            + d.refund_3_424605
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)436120' ,width:180 ,
                    templet:function (d) {
                        const fund_3_436120 =   d.fund_3_436120;
                        var color = ''
                        if(fund_3_436120 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_436120 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_436120 + ' | '
                            + d.open_3_436120 + ' | '
                            + d.refund_3_436120
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)446613' ,width:180 ,
                    templet:function (d) {
                        const fund_3_446613 =   d.fund_3_446613;
                        var color = ''
                        if(fund_3_446613 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_446613 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_446613 + ' | '
                            + d.open_3_446613 + ' | '
                            + d.refund_3_446613
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(3)536025' ,width:180 ,
                    templet:function (d) {
                        const fund_3_536025 =   d.fund_3_536025;
                        var color = ''
                        if(fund_3_536025 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_3_536025 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_3_536025 + ' | '
                            + d.open_3_536025 + ' | '
                            + d.refund_3_536025
                            + '</span>';
                        return html;
                    }
                },
                { field: 'card_set',  align: 'left', title: '(1)527811' ,width:180 ,
                    templet:function (d) {
                        const fund_1_527811 =   d.fund_1_527811;
                        var color = ''
                        if(fund_1_527811 == 0.00){
                            color = 'red';
                        }
                        var html = '';
                        if(d.use_1_527811 == 1){
                            html += '<a style="color: red;font-weight: bold">停</a>';
                        }else{
                            html += '<a style="color: green;font-weight: bold">开</a>';
                        }
                        html += '&nbsp;&nbsp;&nbsp;<span style="color: ' + color +'">'
                            + fund_1_527811 + ' | '
                            + d.open_1_527811 + ' | '
                            + d.refund_1_527811
                            + '</span>';
                        return html;
                    }
                }
            ]],
            done:function(res){
                tdTitle();
            },
            page: true,
            limit: 20,
            limits: [20, 50, 100],
        });
        function tdTitle(){
            $('th').each(function(index,element){
                $(element).attr('title',$(element).text());
            });
            $('td').each(function(index,element){
                $(element).attr('title',$(element).text());
            });
        };
        form.on('submit(*)', function (data) {
            layui.table.reload('balanceTable', {
                where: data.field
                , page: {
                    curr: 1 //重新从第 1 页开始
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
        $(document).on('click', '.SearchDetail', function () {
            var id = $(this).attr('data-id');
            JsGet("{:url('showUserSet')}?type=set&id="+ id, function(e){
                if(e.status == 1){
                    layer.open({
                        type: 1,
                        title: 'Log Detail',
                        area: ['1000px', '600px'], //宽高
                        content: e.datas,
                        btn:['Close']
                    });
                }else{
                    layer.msg(e.msg);
                }
            });
        });
        $(document).on('click', '.editMax', function () {
            var id = $(this).attr('data-id');
            JsGet("{:url('editMax')}?set_id="+id, function(e){
                if(e.status == 1){
                    layer.open({
                        type: 1,
                        title: '自定义卡设置',
                        area: ['700px', '400px'], //宽高
                        content: e.datas,
                        btn:['Confirm','Close'],
                        yes:function (index,layero) {
                            var thedata = $('.operationForm').serialize();
                            var max_card   = $("#max_card").val();
                            if (max_card == '' || !max_card) {
                                layer.msg("请填写最大开卡数." , {icon:2,time:1500});
                                return false;
                            }
                            var rate   = $("#rate").val();
                            if (rate == '' || !rate) {
                                layer.msg("请填写开卡费率." , {icon:2,time:1500});
                                return false;
                            }
                            var open_556735   = $("#open_556735").val();
                            if (open_556735 == '' || !open_556735) {
                                layer.msg("请填写开卡费(556735)." , {icon:2,time:1500});
                                return false;
                            }
                            var open_556305   = $("#open_556305").val();
                            if (open_556305 == '' || !open_556305) {
                                layer.msg("请填写开卡费(556305)." , {icon:2,time:1500});
                                return false;
                            }
                            var open_556766   = $("#open_556766").val();
                            if (open_556766 == '' || !open_556766) {
                                layer.msg("请填写开卡费(556766)." , {icon:2,time:1500});
                                return false;
                            }
                            var open_556766_new   = $("#open_556766_new").val();
                            if (open_556766_new == '' || !open_556766_new) {
                                layer.msg("请填写开卡费(556766(new))." , {icon:2,time:1500});
                                return false;
                            }
                            var open_558068   = $("#open_558068").val();
                            if (open_558068 == '' || !open_558068) {
                                layer.msg("请填写开卡费(558068)." , {icon:2,time:1500});
                                return false;
                            }
                            var open_531847   = $("#open_531847").val();
                            if (open_531847 == '' || !open_531847) {
                                layer.msg("请填写开卡费(531847)." , {icon:2,time:1500});
                                return false;
                            }
                            JsPost('{:url("editMax")}', thedata,function (re) {
                                if(re.code >0){
                                    layer.msg(re.msg , {icon:1,time:1500});
                                    layer.close(index);
                                    tableIn.reload({
                                        page:{
                                            curr :1
                                        }
                                    });
                                }else{
                                    layer.msg(re.msg, {icon:2,time:1500});
                                }
                            });
                        }
                    });
                }else{
                    layer.msg(e.msg);
                }
            });
        });
        table.on('toolbar(balanceTable)', function(obj) {
            const checkStatus = table.checkStatus(obj.config.id);
            const data = checkStatus.data;

            if(obj.event == 'up_rate'){
                if(data.length >0){
                    var id_array = [];
                    for(var i=0;i<data.length;i++){
                        id_array.push(data[i].id);
                    }
                    if(id_array.length >0){
                    }else{
                        layer.msg("至少选择一个用户",{time:2000,icon:16});
                        return false;
                    }
                    JsGet("{:url('setUp')}?id_array="+id_array, function(e){
                        if(e.status == 1){
                            layer.open({
                                type: 1,
                                title: 'UserSet Update',
                                area: ['700px', '500px'], //宽高
                                content: e.datas,
                                btn:['Confirm','Close'],
                                yes:function (index,layero) {
                                    var thedata = $('.operationForm').serialize();
                                    JsPost('{:url("setUp")}', thedata,function (re) {
                                        if(re.code >0){
                                            layer.msg(re.msg , {icon:1,time:1500});
                                            layer.close(index);
                                            tableIn.reload({
                                                page:{
                                                    curr :1
                                                }
                                            });
                                        }else{
                                            layer.msg(re.msg, {icon:2,time:1500});
                                        }
                                    });
                                }
                            });
                        }else{
                            layer.msg(e.msg);
                        }
                    });
                }else{
                    layer.msg("请选择需要更新的用户.",{time:2000,icon:2});
                }
            }
        });
    });
</script>